#!C:\Programme2\Python26\python.exe # -*- coding: Latin-1 -*- # ***** include the biocase.lib directory in the python sys path for importing ***** import os, sys, time execfile( os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.path.pardir, os.path.pardir, os.path.pardir, 'lib', 'biocase', 'adjustpath.py' ) ) ) import cgitb; cgitb.enable() import cgi, logging import biocase.configuration from biocase.tools.templating import PageMacro cfg = biocase.configuration.Cfg() # read template tmpl = PageMacro('Content', PageMacro.DELMODE) tmpl.load('Content', os.path.join(cfg.wwwLocator,'utilities','queryforms','_qf_manual.html') ) # get wrapper url form = cgi.FieldStorage() dsa=None if form.has_key('dsa'): from biocase.datasources import Datasource dsa = form.getfirst('dsa') try: dsaObj = Datasource(name=dsa) wrapper_url = dsaObj.getBioCASeAccessPoint() psfObj = dsaObj.getPSFObj() except: raise "Datasource %s does not exist!"%dsa elif form.has_key('url'): wrapper_url = form.getfirst('url') else: raise "No wrapper URL found!" # fill template with url tmpl['wrapper_url']=wrapper_url if cfg.server.debug: logLoc = cfg.logLocator.replace("\\", "\\\\") if dsa is None: tmpl['cfg.server.debug']='%s. Logs at %s' %(cfg.html.true, logLoc) else: tmpl['cfg.server.debug']='%s. Logs at %s' %(logging.getLevelName(psfObj.loglevel), logLoc) else: if dsa is None: tmpl['cfg.server.debug']='%s. Logs at %s' %(cfg.html.false, logLoc) else: tmpl['cfg.server.debug']='%s. Logs at %s' %(logging.getLevelName(psfObj.loglevel), logLoc) # # print HTML # print 'Content-Type: text/html; charset=utf-8\n\n' print str(tmpl)